From c1071c69a1da0023dcc1ea34d493de45ebd030a8 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 27 Jul 2015 18:08:28 -0700 Subject: [PATCH] Update docopt to fix forwarding `--` Closes #1426 --- Cargo.lock | 4 ++-- tests/test_cargo_run.rs | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63a086d32..aeb60472a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,7 +6,7 @@ dependencies = [ "bufstream 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "crates-io 0.1.0", "curl 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "docopt 0.6.67 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.6.69 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "filetime 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -93,7 +93,7 @@ dependencies = [ [[package]] name = "docopt" -version = "0.6.67" +version = "0.6.69" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "regex 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/tests/test_cargo_run.rs b/tests/test_cargo_run.rs index d0f494520..7d17d3843 100644 --- a/tests/test_cargo_run.rs +++ b/tests/test_cargo_run.rs @@ -437,3 +437,27 @@ test!(run_bin_different_name { assert_that(p.cargo_process("run"), execs().with_status(0)); }); + +test!(dashes_are_forwarded { + let p = project("foo") + .file("Cargo.toml", r#" + [project] + name = "foo" + version = "0.0.1" + authors = [] + + [[bin]] + name = "bar" + "#) + .file("src/main.rs", r#" + fn main() { + let s: Vec = std::env::args().collect(); + assert_eq!(s[1], "a"); + assert_eq!(s[2], "--"); + assert_eq!(s[3], "b"); + } + "#); + + assert_that(p.cargo_process("run").arg("--").arg("a").arg("--").arg("b"), + execs().with_status(0)); +}); -- 2.30.2